package com.example.threadcode.higherLeverFour.ID.v2;

import java.util.concurrent.atomic.AtomicLong;

class ID
{
//  使用原子变量
   private static AtomicLong nextID = new AtomicLong(1);

   static long getNextID()
   {
      return nextID.getAndIncrement();
   }
}